package com.pure.service
{
	import com.pure.ApplicationFacade;
	import com.pure.model.UserProxy;
	import com.pure.model.vo.UserVO;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.events.ResultEvent;
	
	import org.swizframework.utils.services.MockDelegateUtil;
	
	public class DelUserService extends ServiceResponder
	{
		public function getServerResult(info:Object):AsyncToken
		{
			var mockDelegateUtil:MockDelegateUtil = new MockDelegateUtil(); // use lib swiz
			// fake the success result
			return mockDelegateUtil.createMockResult(info, 500);			
		}
		
		override public function onSuccess(e:ResultEvent):void
    	{
    		var facade:ApplicationFacade = ApplicationFacade.getInstance();
			userProxy = UserProxy( facade.retrieveProxy( UserProxy.NAME ) );
			userProxy.deleteItem(e.result as UserVO);
    	}
		
		private var userProxy:UserProxy;
	}
}